package io.github.simplejy.miodemo.bean;

import java.util.ArrayList;

/**
 * Created by macmini20170218 on 2017/3/1.
 * 历史参数数据
 */

public class HistoryParamData {

    private String date;     //日期
    private ArrayList<String> paramsList = new ArrayList<>();    //参数集合

    public String getDate() {
        return date;
    }

    public ArrayList<String> getParamsList() {
        return paramsList;
    }

    public HistoryParamData(String date) {
        this.date = date;
    }

    public void addItem(String param) {
        paramsList.add(param);
    }

    public String getItem(int position) {

        if (position == 0) {
            return date;
        } else {
            return paramsList.get(position - 1);
        }
    }

    /**
     * 当前日期类别Item总数。data也需要占用一个Item
     *
     * @return int
     */
    public int getItemCount() {
        return paramsList.size() + 1;
    }
}
